import { createApp } from 'vue'
import {createStore, Store} from 'vuex'
router.beforeEach((to, from, next) => {

    const nextRoute = ['/newsIndex', '/newsItem', '/routerindex', '/parent'];
        let isLogin = store.getters.getLogin;
    if (nextRoute.indexOf(to.path) >= 0) {
        if (!isLogin) {
            router.push({
                path: '/login'
            })
        }
    }
    next(); //必须要有
});
import App from '@/views/LoginView.vue'
// import Parent from "@/components/Parent.vue";
// import Parent from "@/components/Parent.vue";
// createApp(App).mount('#app')
// createApp(App).mount('#app')
import store from "@/store";
// const store = createStore({
//     state(){
//         return{
//             count: 0
//         }
//     },
//     mutations:{
//         increment(state){
//             state.count++
//         }
//     }
// })
const app = createApp(App)
app.use(store)
import router from "@/router";

app.use(router)

app.mount('#app')
